package com.coolwen.service;


import com.coolwen.entity.Resource;
import com.coolwen.entity.Role;
import com.coolwen.entity.RoleResource;
import com.coolwen.entity.UserRole;

import java.util.List;

/**
 * Created by user on 2016/6/8.
 */
public interface RoleService {

     void add(Role role);

     void delete(long id);

     Role load(long id);

     void update(Role role);

     List<Role> listRole();


     UserRole loadUserRole(long uid, long roleId);

     void addRoleResource(long roleId,long resId);


    /**
     * 删除某个用户的所有角色
     *
     * @param uid
     */
     void deleteUserRoles(long uid);

    /**
     * 根据角色id获取可以访问的所有资源
     *
     * @param roleId
     * @return
     */
     List<Resource> listRoleResource(long roleId);


     int deleteRoleResource(long roleId, long resId);


}
